package four;

public class Village {
    private static int waterAmount;
    private String name;
    private int population;

    public Village(String name, int population) {
        this.name = name;
        this.population = population;
    }

    public static void setWaterAmount(int amount) {
        waterAmount = amount;
    }

    public static int getWaterAmount() {
        return waterAmount;
    }

    public void drinkWater(int amount) {
        waterAmount -= amount;
        System.out.println(this.name + "喝了" + amount + "升水");
    }

    public void checkWater() {
        System.out.println(this.name + "发现水井中有 " + waterAmount + " 升水");
    }

    public String getName() {
        return this.name;
    }

    public int getPopulation() {
        return this.population;
    }
}
